Adding some more judges, here and there.
[and.git] / lib / Mi manual de algoritmos / version_maraton_nacional_2008 / src / grafos / floyd.cpp
blobb997e7c5bd6a8f334dc5206d5a7e860d249c2e64
1 /*
2 g[i][j] = Distancia entre el nodo i y el j.
3 */
4 unsigned long long g[101][101];
6 void floyd(){
7 //Llenar g
8 //...
10 for (int k=0; k<n; ++k){
11 for (int i=0; i<n; ++i){
12 for (int j=0; j<n; ++j){
13 g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
18 Acá se cumple que g[i][j] = Longitud de la ruta más corta de i a j.